import request from '@/utils/request'

const api_name = `account`

export default {
    listAccountPage(current,limit,searchObj){
        return request({
            url: `${api_name}/list/${current}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    addAccount(jshAccount){
        return request({
            url: `${api_name}/add`,
            method: 'post',
            params: jshAccount
        })
    },
    updateAccount(jshAccount){
        return request({
            url: `${api_name}/update`,
            method: 'put',
            params: jshAccount
        })
    },
    batchDel(ids){
        return request({
            url: `${api_name}/batchDel`,
            method: 'delete',
            data: ids
        })
    },
    batchUpdateStatus(status,ids){
        return request({
            url: `${api_name}/batchUpdateStatus/${status}`,
            method: 'put',
            data: ids
        })
    },
    checkAccountByName(name){
        return request({
            url: `${api_name}/checkAccountByName/${name}`,
            method: 'get'
        })
    },
    deleteById(id){
        return request({
            url: `${api_name}/delete/${id}`,
            method: 'delete'
        })
    },
    updateIsDefault(id){
        return request({
            url: `${api_name}/updateIsDefault/${id}`,
            method: 'post',
            params: {
                isDefault: true
            }
        })
    }
}